#! /usr/bin/python
# Filename: cat.py

import sys;

def readfile(filename):
	try:
		f = file(filename);
		while True:
			line = f.readline();
			if len(line) == 0:
				break;
			print line;
	finally:
		f.close();

def usage(a,*argv):
	print 'Usage: %s %s' % (a,argv);

def version():
	print 'Ver1.0';
def help(a):
	usage(a,helpinfo);

#
helpinfo = '--help | --version | file1 file2...';
if len(sys.argv) < 2:
	usage(sys.argv[0],helpinfo);
	sys.exit();
if sys.argv[1].startswith('--'):
	option = sys.argv[1][2:]
	if option == 'version':
		version();
	elif option == 'help':
		help(sys.argv[0]);
	else:
		print 'Unknow option: %s' % option;
else:
	for filename in sys.argv[1:]:
		readfile(filename);

